fix(node): handle slot zero in getL2ToL1Messages (backport to v4-next)#21418
Merged
spalladino merged 2 commits intobackport-to-v4-next-stagingfrom Mar 12, 2026
Merged
Conversation
spalladino
approved these changes
Mar 12, 2026
ludamad
pushed a commit
that referenced
this pull request
Mar 12, 2026
#21418) Backport of #21386 to v4-next. If there was a block in L2 slot zero, then `getL2ToL1Messages` returned an incorrect response, since the `slotNumber !== previousSlotNumber` would fail in the first iteration of the loop. Fix replaces manual loop with `chunkBy` utility. Minor import conflict in `server.test.ts` — v4-next didn't have `BlockHash` in the block import (not needed by new tests). Resolved by importing only `CheckpointedL2Block` and `L1PublishedData`. #21386 by @spalladino ClaudeBox log: https://claudebox.work/s/759eab130be2139b?run=1 --------- Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #21386 to v4-next.
If there was a block in L2 slot zero, then
getL2ToL1Messagesreturned an incorrect response, since theslotNumber !== previousSlotNumberwould fail in the first iteration of the loop. Fix replaces manual loop withchunkByutility.Conflicts
Minor import conflict in
server.test.ts— v4-next didn't haveBlockHashin the block import (not needed by new tests). Resolved by importing onlyCheckpointedL2BlockandL1PublishedData.Original PR
#21386 by @spalladino
ClaudeBox log: https://claudebox.work/s/759eab130be2139b?run=1